/**
 * Yuliy Khorolinskyy
 * 2011
 *
 * Reaktionsspiel
 * schratch
 * MyCanvas.java
 *
 */
package schratch;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.LayoutManager;
import java.awt.Point;
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;

import javax.swing.JPanel;

/**
 * @author y.khorolinskyy
 *
 */
public class MyCanvas extends JPanel {
	
	
	/**
	 * 
	 */
	public MyCanvas() {
		this.setPreferredSize(new Dimension(400, 400));

	}
	
	 /* (non-Javadoc)
	 * @see javax.swing.JComponent#paint(java.awt.Graphics)
	 */
	@Override
	public void paint(Graphics g) {
		
		Graphics2D g2 = (Graphics2D) g;
		Point p1 = new Point(40, 10);
		Point p2 = new Point(300, 70);
		
		
		g2.draw(new Line2D.Float(p1, p2));
		this.revalidate();
		super.paint(g);
	}

	
}
